$(function() {
	var allDeviceDiv = $(".container-fuil")

	var deviceIds = []
	var devices = []
	function genDeviceInfo() {
		allDeviceDiv.html('')
		for (var i = 0; i < 10; i++) {
			var id = 'div' + (i + 1)
			deviceIds.push(id)
			allDeviceDiv.append(getDiv(id))
			var div = $("#" + id)
			devices.push(div)
			div.find(".info").html(
					'设备名称：VHT'+i+'T<br/>'
					+ '设备类型：'+'SLM'+'<br/>'
					+ '加工范围：'+'0-255'+'<br/>'
					+ '激光最大功率：'+'2500W'+'<br/>'
					+ '光斑直径：0.1mm<br/>'
					+ '加工层厚范围：0.02-1.0mm<br/>')
		}

	}
	function getDiv(id) {
		var div = '<div id=' + id + ' class="my-main">' 
		+ '<div class="process device-process"><div class="process-bar"><div class="process-value"></div></div></div>' 
		+ '<div class="info device-info"></div>' 
		+ '</div>'
		return div
	}

	var added = 0.001
	var init = 0.02
	function refreshData() {
		for (var i = 0; i < deviceIds.length; i++) {
			init = init + added
			if (init > 1) {
				init = 0.01
			}
			var process=devices[i].find(".process-value")
			var percent=(init * 100 + "").substring(0, 2)+"%"
			process.text( percent)
			process.css("width",percent)
		}
	}

	genDeviceInfo()
	var timer = setInterval(refreshData, 1000);
})

// var option = getOption((0.01 * i).toFixed(2))
// var panel = document.getElementById(id);
// var cart = echarts.init(panel);
// cart.setOption(option);
/**
 * var value = 0.25
 * 
 * function getOption(value) { var data = [] data.push(value) data.push(value)
 * data.push(value) data.push(value) data.push(value) var option = {
 * backgroundColor : '#1b2735', title : { text : 'CPU使用率', textStyle : {
 * fontWeight : 'normal', fontSize : 14, color : 'white' } }, series : [ { type :
 * 'liquidFill', radius : '80%', data : data, backgroundStyle : { borderWidth :
 * 4, borderColor : 'rgb(255,0,255,0.9)', color : 'rgb(255,0,255,0.01)' }, label : {
 * normal : { formatter : value * 100 + '%', textStyle : { fontSize : 25 } } } } ] }
 * return option }
 */
